<template>
  <div class="block">
    <el-pagination
      :page-sizes="[10, 20, 30, 40]"
      :page-size="params.size"
      layout="total, sizes,prev, pager, next, jumper"
      :total="total"
      :current-page="params.current"
      style="text-align: center; margin-top: 20px"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
    />
  </div>
</template>

<script>
export default {
  props: {
    total: {
      type: Number,
      default: 0
    },
    params: {
      type: Object,
      default: () => {}
    }
  },
  methods: {
    handleSizeChange(newSize) {
      this.params.size = newSize
      this.$emit('updataTable', this.params)
    },
    handleCurrentChange(newPage) {
      this.params.current = newPage
      this.$emit('updataTable', this.params)
    }
  }
}
</script>

<style>

</style>
